package com.zhiliao.module.web.cms.service;

import com.github.pagehelper.PageInfo;
import com.zhiliao.common.base.BaseService;
import com.zhiliao.module.web.cms.vo.TCmsContentVo;
import com.zhiliao.mybatis.model.TCmsContent;
import com.zhiliao.mybatis.model.TCmsModelFiled;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * Description:内容
 *
 * @author Jin
 * @create 2017-04-18
 **/
public interface  ContentService extends BaseService<TCmsContent,Long> {

    /**
     * page
     * @param pageNumber
     * @param pageSize
     * @param pojo
     * @return
     */
    PageInfo<TCmsContent> page(Integer pageNumber, Integer pageSize, TCmsContentVo pojo);

    /**
     * findContentByContentIdAndTableName
     * @param contentId
     * @param tableName
     * @return
     */
    Map findContentByContentIdAndTableName(Long contentId, String tableName);

    /**
     * 回收站
     * @param ids
     * @return
     */
    String recovery(Long[] ids);

    /**
     * save
     * @param content
     * @param tableName
     * @param formParam
     * @param tag
     * @return
     * @throws SQLException
     */
    String save(TCmsContent content,String tableName, Map<String, Object> formParam,String[] tag) throws SQLException;

    /**
     * update
     * @param content
     * @param tableName
     * @param cmsModelFileds
     * @param formParam
     * @param tag
     * @return
     * @throws SQLException
     */
    String update(TCmsContent content, String tableName, List<TCmsModelFiled> cmsModelFileds , Map<String, Object> formParam, String[] tag) throws SQLException;

    /**
     * findContentListBySiteIdAndCategoryId
     * @param siteId
     * @param categoryId
     * @param orderBy
     * @param pageNumber
     * @param pageSize
     * @param hasChild
     * @param isHot
     * @param isPic
     * @param isRecommend
     * @return
     */
    PageInfo<Map> findContentListBySiteIdAndCategoryId(Integer siteId, Long categoryId, Integer orderBy, Integer pageNumber, Integer pageSize, Integer hasChild, Integer isHot, Integer isPic, Integer isRecommend);

    /**
     * findTopicContentListBySiteIdAndCategoryIds
     * @param siteId
     * @param categoryIds
     * @param orderBy
     * @param size
     * @param isHot
     * @param isPic
     * @param isRecommend
     * @return
     */
    PageInfo<Map> findTopicContentListBySiteIdAndCategoryIds(Integer siteId, Long[] categoryIds, Integer orderBy, Integer size, Integer isHot, Integer isPic, Integer isRecommend);

    /**
     * page
     * @param pageNumber
     * @param siteId
     * @param categoryId
     * @return
     */
    PageInfo<Map> page(Integer pageNumber,Integer siteId,Long categoryId);

    /**
     * findContentListByModelFiledValue
     * @param pageNumber
     * @param categoryId
     * @param tableName
     * @param param
     * @return
     */
    PageInfo<TCmsContent>  findContentListByModelFiledValue(int pageNumber,Long categoryId, String tableName, Map<String, Object> param);

    /**
     * viewUpdate
     * @param contentId
     */
    void viewUpdate(Long contentId);

    /**
     * findAllMonthCount
     * @return
     */
    String findAllMonthCount();

    /**
     * AllCount
     * @return
     */
    Integer allCount();

    /**
     * findByCategoryId
     * @param categoryId
     * @return
     */
    List<TCmsContent> findByCategoryId(Long categoryId);
}
